<layout name="master"/>
<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#">品牌管理</a></li>
    <li><a href="#">添加品牌</a></li>
</ul>
<div class="m-b-md">
    <h3 class="m-b-none">添加品牌</h3>
</div>
<div class="row">
    <div class="col-sm-12">
        <section class="panel panel-default">
            <header class="panel-heading font-bold">添加品牌</header>
            <div class="panel-body">
                <form action="" method='post' enctype="multipart/form-data">
                    <div class="container-fluid">
                        <div class="row-fluid">
                            <div class="span12">
                                <fieldset>
                                    <legend>添加商品品牌</legend>
                                    <table class="table table-bordered table-hover">
                                        <tr class="info">
                                            <td>品牌名称</td>
                                            <td colspan="2">
                                                <input type="text" name='bname' value="{$oldData['bname']}"/>
                                            </td>
                                        </tr>
                                        <tr class="info">
                                            <td>品牌LOGO</td>
                                           <?php if(isset($oldData['logo'])){?>
                                            <td>
                                                <img style="width: 20px;" src="__ROOT__/Uploads/{$oldData['logo']}" alt="">
                                                <input  type="file" name="logo" />
                                            </td>
                                            <?php }else{?>
                                            <td>
                                                <input  type="file" name="logo" />
                                            </td>
                                            <?php }?>
                                            <!--<td>-->
                                                <!--<div id='logo-wrap' style='display:none'></div>-->
                                            <!--</td>-->
                                        </tr>
                                        <tr class="info">
                                            <td>是否热门</td>
                                            <td colspan="2">
                                                <input type="checkbox" name='ishot' value="{$oldData['ishot']}"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan='3' align='center'>
                                                <input type="submit" class="btn btn-primary" value="添加品牌" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </div>
                        </div>
                    </div>
                </form>

            </div>
        </section>
    </div>
</div>
<script>
    $(function() {
        $("#file_upload").uploadify({
            "height"        : 30,
            "swf"           : '__PUBLIC__/uploadify/uploadify.swf',
            "uploader"      : "{:u('admin/brand/upload')}",
            "width"         : 30,
            'removeTimeout' : 0.1,
            //'buttonClass' : 'red',
            'buttonText' : 'BROWSE...',
            'onUploadSuccess' : function(file, data, response) {
                //console.log(data);
                str = '<li>';
                str += '<img style="width: 20px" src="__ROOT__/'+data+'" alt="">';
                str += '<input type="hidden" name="" value="'+data+'">';
                str += '<a href="javascript:;" onclick="delImg(this)" path="'+data+'">X</a>';
                str += '</li>';
                $('.box').append(str);
            }
        });
    });
</script>
